import type { Ref } from 'vue'
import DeliveryOrder from '../entity/DeliveryOrder'
import GeoCoordinates from '../generic/GeoCoordinates'

export class NearbyDeliveryOrder extends DeliveryOrder {
  shopDistance: number
  shopToUserDistance: number
}

export class SystemDispatchNearbyDeliveryOrder extends NearbyDeliveryOrder {
  /**
   * 锁定时长（派发给骑手特权时间）
   * （单位：秒）
   */
  lockTime: Ref
}

export class WaitPickingDeliveryOrder extends DeliveryOrder {
  /**
   * 可取餐的时间戳
   */
  canPickUpTimeStamp?: number

  /**
   * 可取餐的剩余的秒（前端添加）
   */
  canPickUpSecond?: number
}

export class DinersForMap extends GeoCoordinates {
  id: number

  shopId: number

  consigneeName: string

  addressDescribe: string

  navigationSort: number

  isWaitFetch: boolean

  code: number

  codes?: Array<number>
}

export class ShopForMap extends GeoCoordinates {
  id: number

  shopName: string

  addressDescribe: string

  navigationSort?: number

  isHasWaitFetchOrder: boolean

  dinersForMaps: DinersForMap[]
}

export interface OrderDetail {
  id: number

  orderId: number

  dishId: number

  name: string

  image?: string

  dishFlavor: string

  appreciation?: number

  specPrice: number

  count: number
}

export class DeliveryOrderDetailsVO extends NearbyDeliveryOrder {
  /**
   * 订单备注信息
   */
  remark?: string
  /**
   * 下单时间
   */
  payTime: string

  /**
   * 订单菜品列表
   */
  dishList: OrderDetail[]
}

/**
 * 已完成数量统计vo
 *
 * @author zhuangjie
 * @date 2024/04/04
 */
export default class CompletedQuantityStatistics {
  /**
   * 完成的单量
   */
  public completedQuantity: number

  /**
   * 收入
   */
  public income: number
}
